<?php
	session_cache_limiter('private,must-revalide');  
    include_once("config.php");    
	$id= $_GET['id'];	
	$hou_num= $_GET['hou_num'];	
	$query = "SELECT * FROM $TBL_LEASE where id='$id' "; 
	$result = mysql_query($query);
	$rows = @mysql_fetch_array($result);
	$hou_num = $rows['hou_num'];
	$tel = $rows['tel'];
	$addtime  = $rows['addtime'];
	$admin_name = $rows['admin_name'];	
	$time = date("Y-m-d H:i:s");
	$query2 = "SELECT * FROM $TBL_REINFO where hou_num='$hou_num'"; 
	$reseult2 = mysql_query($query2);
	if(@mysql_num_rows($reseult2)<1)
	{	
		$insert = "insert into $TBL_REINFO (id,hou_num,tel,addr,date,type,mess,datetime,mem_id)
		values (null,'$hou_num','$tel','-','$addtime ','房屋出租','簽約轉移','$time','$admin_name')";	
	
		if(mysql_query($insert))
		{
			MyNotice("成功轉移租出回報", 1, "index.php");
		}else{
			MyNotice("失敗轉移租出回報", 1, "login.php");
		}
	}else{
		MyNotice("已經在租出回報中", 1, "login.php");
		exit(0);  
	}
	exit(0);  
	
   
  
?>